package org.sucri.floxs.model;

import org.apache.commons.collections15.MultiMap;
import org.sucri.floxs.Tools;

import java.util.List;
import java.util.ArrayList;
import java.lang.reflect.Method;

/**
 * Created by IntelliJ IDEA.
 * User: Wen Yu
 * Date: Aug 11, 2007
 * Time: 8:49:15 PM
 * To change this template use File | Settings | File Templates.
 */
public class AnnotationFields
{
  private List<String>             mGroups = null;
  private MultiMap<String, Method> mColumnMethods = null;
  private List<Method>             mMethods = null;

  public void setGroups(                   List<String> s) { mGroups = s; }
  public void setColumnMethods(MultiMap<String, Method> s) { mColumnMethods = s; }

  public Method                   getColumnMethod(int s) { return mMethods.get(s); }
  public MultiMap<String, Method> getColumnMethods()     { return mColumnMethods; }
  public List<Method>             getMethods()           { return mMethods; }
  public List<String>             getGroups()
  {
    if (!Tools.good(mGroups) && Tools.good(mColumnMethods)) 
    {
      mGroups = new ArrayList<String>(mColumnMethods.keySet().size());
      mGroups.addAll(mColumnMethods.keySet());
    }
    return mGroups;
  }
  public void setMethods(List<Method> s) { mMethods = s; }
}
